import { v4 as uuidv4 } from 'uuid';
export const getUUID = () => {
    //从localStorage中读取用户令牌
    let uuid_token = localStorage.getItem("UUIDTOKEN")
    //判断是否有用户令牌
    if (!uuid_token) {
        //如果没有，生成一个随机字符串，做为用户令牌，并存储在localStorage中
        uuid_token = uuidv4()
        localStorage.setItem("UUIDTOKEN", uuid_token)
    }
    return uuid_token;
}